// import express from 'express';
// import controller from './controller';
// import {authorizeHandlerNormal, authorizeHandleAdmin} from '../../middlewares/authorize';
// // 定义路由，使用鉴权中间件
// export default express
//   .Router()
//   .get('/get', authorizeHandlerNormal ,controller.get) 
//   .post('/add', authorizeHandleAdmin ,controller.add)
//   .post('/update', authorizeHandleAdmin ,controller.update);
 

import express from 'express';
import controller from './controller';
import {authorizeHandlerOptional, authorizeHandleAdmin} from '../../middlewares/authorize';
// 定义路由，使用可选鉴权中间件（未登录也能访问）
export default express
  .Router()
  .get('/get', authorizeHandlerOptional ,controller.get) 
  .post('/add', authorizeHandleAdmin ,controller.add)
  .post('/update', authorizeHandleAdmin ,controller.update);